package org.liang.system.service.impl;

import org.liang.auth.dto.LoginDTO;
import org.liang.base.service.impl.BaseServiceImpl;
import org.liang.system.domain.Employee;
import org.liang.system.domain.EmployeeDTO;
import org.liang.system.mapper.EmployeeMapper;
import org.liang.system.service.IEmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional(propagation = Propagation.SUPPORTS,readOnly = true)
public class EmployeeServiceImpl extends BaseServiceImpl<Employee> implements IEmployeeService {
    @Autowired
    private EmployeeMapper employeeMapper;

    @Override
    public Employee selectByUserName(LoginDTO loginDTO) {
        return employeeMapper.selectByUserName(loginDTO);
    }

    @Override
    public List<EmployeeDTO> queryAll(String key) {
        return employeeMapper.queryAll(key);
    }

    @Override
    public List<EmployeeDTO> queryAll() {
        return employeeMapper.queryAll();
    }

    @Override
    public void batchInsert(List<EmployeeDTO> right) {
        employeeMapper.batchInsert(right);
    }

    @Override
    public List<String> selectPermissionSnsById(Long id) {
        return employeeMapper.selectPermissionSnsById(id);
    }
}
